package com.lzw.mapper.dormitoryAdmin;

import com.lzw.pojo.Announcement;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface AnnounceMapper {
    List<Announcement> list(@Param("datePosted") LocalDate datePosted, @Param("postedBy") String postedBy);

    @Insert("INSERT INTO dormitorymanagement.announcement(title, content, date_posted, posted_by) VALUES (#{title}, #{content}, #{datePosted}, #{postedBy})")
    void add(Announcement announcement);
}
